package com.tqjc.system.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Arrays;
import java.util.List;

/**
 * @author 86195
 * @version 1.0
 * @description 道闸名称枚举类
 * @date 2023/10/8 14:08
 */
@NoArgsConstructor
@AllArgsConstructor
@Getter
public enum GateNameEnum {

    GATE_1_INLET("0", Arrays.asList(0,1),"道闸1入口"),
    GATE_1_OUTLET("1", Arrays.asList(2,3),"道闸1出口"),
    GATE_2_INLET("2", Arrays.asList(4),"道闸2入口"),
    GATE_2_OUTLET("3", Arrays.asList(5),"道闸2出口");


    /**
     * 前端传值  道闸value
     */
    private String gateValue;

    /**
     * 硬件道闸口下标值
     */
    private List<Integer> gateIndexList;

    /**
     * 描述
     */
    private String desc;


    public static List<Integer> getGateIndexList(String gateValue){
        for (GateNameEnum value : GateNameEnum.values()) {
            if(value.getGateValue().equals(gateValue)){
                return value.getGateIndexList();
            }
        }

        return null;
    }


}
